//
//  TodoCell.m
//  CoreData-Demo
//
//  Created by zhaoguoteng on 2020/4/23.
//  Copyright © 2020 gaven. All rights reserved.
//

#import "TodoCell.h"

@interface TodoCell ()

@property(nonatomic, strong) IBOutlet UILabel *contentLabel;
@property(nonatomic, strong) IBOutlet UILabel *dateLabel;

@end

@implementation TodoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(Todo *)model {
    _model = model;
    
    self.contentLabel.text = model.content;
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    dateFormatter.dateFormat = @"yyyy-MM-dd hh:mm:ss";
    self.dateLabel.text = [dateFormatter stringFromDate:model.date];
}

@end
